package com.xiangqian.factory;

import com.xiangqian.enums.DatabaseType;
import com.xiangqian.service.DatabasePoll;
import com.xiangqian.serviceimpl.MysqlDatebasePoll;
import com.xiangqian.serviceimpl.OracleDatebasePoll;
import com.xiangqian.serviceimpl.SqlserverDatebasePoll;

public class DatabasePollFactory {

    public static DatabasePoll createDatabasePoll(DatabaseType databaseType) {
        switch (databaseType) {
            case MYSQL:
                return new MysqlDatebasePoll();
            case ORACLE:
                return new OracleDatebasePoll();
            case SQLSERVER:
                return new SqlserverDatebasePoll();
            default:
                throw new IllegalArgumentException("Unsupported database type: " + databaseType);
        }
    }
}
